﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Advanced_Search.aspx.cs" Inherits="AdvancedSearch" MaintainScrollPositionOnPostback="true" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Src="~/Pfoot.ascx" TagPrefix="uc1" TagName="Pfoot" %>
<%@ Register Src="~/header.ascx" TagPrefix="uc1" TagName="header" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>地质资料高级检索</title>
    <link rel="shortcut icon" href="pic/mark.ico" />
    <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
    <link href="css/all.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="js/date/WdatePicker.js"></script>
    <script type="text/javascript" src="js/Utils.js"></script>
    
    <script type="text/javascript" src="js/BannerSlide.js"></script>
    <script src="http://api.map.baidu.com/api?v=1.4" type="text/javascript"></script>

    <script type="text/javascript">
        var mymap;
        function initialize() {
            mymap = new BMap.Map('map');
            mymap.centerAndZoom(new BMap.Point(113.404, 39.915), 4);
            mymap.addControl(new BMap.NavigationControl({ anchor: BMAP_ANCHOR_TOP_RIGHT }));
            mymap.addControl(new BMap.ScaleControl());
            mymap.addControl(new BMap.OverviewMapControl({ anchor: BMAP_ANCHOR_BOTTOM_RIGHT, offset: new BMap.Size(10, 10), isOpen: 1 }));

            //map.addControl(new BMap.OverviewMapControl({anchor: BMAP_ANCHOR_BOTTOM_RIGHT, offset: new BMap.Size(10, 10),isOpen:1}))
            var menu = new BMap.ContextMenu();
            var txtMenuItem = [
              {
                  text: '放大',
                  callback: function () { mymap.zoomIn() }
              },
              {
                  text: '缩小',
                  callback: function () { mymap.zoomOut() }
              },
              {
                  text: '放置到最大级',
                  callback: function () { mymap.setZoom(18) }
              },
              {
                  text: '查看全国',
                  callback: function () { mymap.setZoom(4) }
              }
            ];


            for (var i = 0; i < txtMenuItem.length; i++) {
                menu.addItem(new BMap.MenuItem(txtMenuItem[i].text, txtMenuItem[i].callback, 100));
                if (i == 1) {
                    menu.addSeparator();
                }
            }
            mymap.addContextMenu(menu);
        }

        function aclick(x, y, fileID, title, CollectAgens) {
            var point = new BMap.Point(Trans(y), Trans(x));
            mymap.panTo(point);
            var marker = new BMap.Marker(point);
            mymap.addOverlay(marker);

            mymap.centerAndZoom(point, 10);
            var opts = {
                width: 250,
                height: 70

            };
            //var ct='<a  href="GeoDataDetails.aspx?FID='+fileID+'" target="_blank" style="color:red">'+fileID+'</a>'+'<div style="font-size:12px">'+title+'+</div>';
            var ct = '<div style=" font-size:15px; line-height:25px;  ">' + fileID + '<br/>' + title + '<br/>' + '<a  href="GeoDataDetails.aspx?FID=' + fileID + '"target="_blank" style="color:red;margin-left:200px;line-height:20px;font-size:15px;">>>详情</a></div>';
            var infoWindow = new BMap.InfoWindow(ct, opts);
            marker.openInfoWindow(infoWindow);

            document.getElementById("summary").innerHTML = "<table style='background:url(pic/spatialtips.png) no-repeat;width:400px; height:80px; padding-left:10px;position:releative;'><tr><td >档号：" + fileID + "</td></tr> <tr><td>题名：" + title + "</td></tr><tr><td>形成单位：" + CollectAgens + "</td></tr></table>";

        }
        function Trans(value) {
            var a = Math.floor(value / 10000);
            var b = Math.floor(value % 10000 / 100);
            var c = Math.floor(value % 100);
            return a + (b + (c / 60)) / 60;
        }

        function rs() {
            divtomoveObj = document.getElementById("divtomove");
            divtomoveObj.style.posLeft = (document.body.clientWidth - divtomoveObj.offsetWidth) / 2;
        }


        // 编写自定义函数,创建标注
        function addMarker(point) {
            var marker = new BMap.Marker(point);
            map.addOverlay(marker);
        }


        function addpoint(count) {
            for (var i = 0; i < count; i++) {
                var point = new BMap.Point(Trans(<%#Eval("START_LATITUDE")%>), Trans(<%#Eval("START_LONGITUDE")%>));
                addMarker(point);
            }
        }

    </script>
</head>
<body onload="javascript:initialize();rs(); window.scrollTo(500,500) ">
    <form id="form1" runat="server">
        <uc1:header runat="server" ID="header" />
        <div id="big">
            <div id="Div2">
                <table width="850" border="0" align="center" cellpadding="0" cellspacing="0" style="margin: auto; padding: 10px;">
                    <tr>
                        <td>题 &nbsp;&nbsp;名</td>
                        <td>
                            <asp:TextBox ID="TITLE" runat="server" Width="250px" Height="20px"></asp:TextBox>
                        </td>
                        <td>档 &nbsp;&nbsp;号</td>
                        <td>
                            <input type="text" name="FILE_ID" id="FILE_ID" style="width: 250px; height: 20px;" /></td>
                    </tr>
                    <tr>
                        <td>关键词</td>
                        <td>
                            <input type="text" name="KEY_WORDS" id="KEY_WORDS" style="width: 250px; height: 20px;" /></td>
                        <td>形成单位</td>
                        <td>
                            <input type="text" name="UNIT" id="UNIT" style="width: 250px; height: 20px;" /></td>
                    </tr>
                    <tr>
                        <td>资料类别</td>
                        <td>
                            <select id="DATA_CLASS" name="DATA_CLASS" style="width: 250px; height: 25px;">
                                <option value="">----------</option>
                                <option value="区调">区调</option>
                                <option value="矿调">矿调</option>
                            </select>
                        </td>
                        <td>工作程度</td>
                        <td>
                            <select id="WORK_LEVEL" name="WORK_LEVEL" style="width: 250px; height: 25px;">
                                <option value="">----------</option>
                                <option value="1/100万">1/100万</option>
                                <option value="1/50万">1/50万</option>
                                <option value="1/25万">1/25万</option>
                                <option value="1/20万">1/20万</option>
                                <option value="1/10万">1/10万</option>
                                <option value="1/5万">1/5万</option>
                                <option value="其他比例尺">其他比例尺</option>
                                <option value="预查">预查</option>
                                <option value="普查">普查</option>
                                <option value="详查">详查</option>
                                <option value="勘探">勘探</option>
                                <option value="开发勘探">开发勘探</option>
                                <option value="钻井地质">钻井地质</option>
                                <option value="其他">其他</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td height="28" align="left">矿&nbsp;&nbsp;种</td>
                        <td>
                            <input type="text" name="MineType" id="MineType" style="width: 250px; height: 20px;" />
                            <img src=" pic/kc.png" width="16" height="16" align="absmiddle" onclick="showUploadDialog()" style="cursor: pointer; vertical-align: bottom;" /></td>
                        <td align="left">行政区划</td>
                        <td>
                            <input type="text" name="XZArea" id="XZArea" style="width: 250px; height: 20px;" /><img src=" pic/kc.png" width="16" height="16" align="absmiddle" onclick="showUploadDialogt()" style="cursor: pointer; vertical-align: bottom;" /></td>
                    </tr>
                    <tr>
                        <td>形成时间</td>
                        <td colspan="3">

                            <input type="text" id="START_DATE" name="START_DATE" value="" style="width: 178px; height: 20px;" onfocus="WdatePicker()" />
                            <img src=" img/calendar.gif" width="18" height="20" alt="开始时间" style="cursor: pointer" />
                            &nbsp;到&nbsp;<input type="text" id="END_DATE" name="END_DATE" value="" style="width: 178px; height: 20px;" onfocus="WdatePicker()" />
                            <img src=" img/calendar.gif" width="18" height="20" alt="结束时间" style="cursor: pointer" />
                        </td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>
                            <asp:ImageButton src="pic/search.png" ID="SearchBtn" runat="server"
                                OnClick="SearchBtn_Click" />
                        </td>
                    </tr>
                </table>
            </div>
            <div style="width: 990px; height: 650px; float: left; display: none;" id="advanceResult" runat="server">
                <div id="sdetailleft">
                    <div id="sdetailLT">档号&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题名 </div>
                    <div style="width: 100%; overflow: hidden;">
                        <div align="left" class="list" style="min-height: 500px;">
                            <div style="height: 470px; float: left; overflow: hidden; position: relative;">
                                <asp:DataList ID="dl_FileList" runat="server" Width="370">
                                    <ItemTemplate>
                                        <a id="DocFile" class="tbl2" href="javascript:void(0)"
                                            onclick="aclick(<%#Eval("START_LATITUDE")%>,<%#Eval("START_LONGITUDE")%>,'<%#Eval("FILE_ID")%>','<%#Eval("TITLE")%>','<%#Eval("GC_DEPART")%>');">[<%#Eval("FILE_ID")%>]&nbsp;&nbsp;&nbsp;&nbsp;<%#Eval("Title")%></a>
                                        <a href="GeoDataDetails.aspx?FID=<%#Eval("FILE_ID")%>" target="_blank" style="width: 10%; float: right; overflow: hidden; text-align: center; line-height: 30px;">详情</a>
                                    </ItemTemplate>
                                </asp:DataList>
                            </div>
                            <div style="overflow: hidden; position: relative; width: 100%;">
                                <webdiyer:AspNetPager ID="AspNetPager1" CssClass="paginator" runat="server" PageSize="15" ShowBoxThreshold="1" AlwaysShow="True" FirstPageText="首页" LastPageText="末页" CurrentPageButtonClass="cpb" Width="300"
                                    NextPageText="下一页" PrevPageText="上一页" OnPageChanging="AspNetPager1_PageChanging">
                                </webdiyer:AspNetPager>
                            </div>
                        </div>
                    </div>
                </div>
                <div id="sdetailright">
                    <div id="summary" style="height: auto; padding-top: 10px; line-height: 18px; margin-left: 10px; color: red; position: absolute; font-family: '微软雅黑'; font-size: 13px; z-index: 100; overflow: hidden; text-align: left; float: left;"></div>
                    <div id="map" name="map" style="width: 680px; height: 530px; border: 0px solid #3F0; overflow: hidden;" marginwidth="0" marginheight="0" scrolling="no"></div>
                </div>
            </div>
        </div>
        <div id="foot_UC">

            <div id="foot">
                <uc1:Pfoot runat="server" ID="Pfoot" />
            </div>
        </div>
    </form>
</body>
</html>
